{extend name="base"/}
{block name="title"} 社区中心
{/block} {block name="css"}
<link rel="stylesheet" href="__MOBILE__/css/zhang.css">
{/block}
{block name="content"}
<div class="head">
    <div class="head_left"><a href="javascript:history.go(-1)"><img src="__MOBILE__/images/true.png" alt=""></a></div>
    <div class="head_con">社区中心</div>
    <div class="head_right"></div>
</div>
    <!-- 图片部分 -->
   <div class="bannner">
        <img src="__MOBILE__/images/upbanner.png" alt="">
   </div>
   <!-- 内容部分 -->
   <div class="upvipcenter">
       <h1>当前等级：{$level_grade}</h1>
       <div class="upvipdetail">
           <span class="vipname">
               <!-- <img src="__MOBILE__/images/vipuncheck.png" alt="" class="vipsign"> -->
                <span class="grade" data-id="1">节点</span>
            </span>
           <span class="vipprice">￥{$vip[0]['tip']}+{$vip[0]['condition']}GMOD</span>
           <div class="clear"></div>
       </div>
       <div class="upvipdetail">
            <span class="vipname">
                 <span class="grade" data-id="2">超级节点</span>
             </span>
            <span class="vipprice">￥{$vip[1]['tip']}+{$vip[1]['condition']}GMOD</span>
            <div class="clear"></div>
        </div>
        <div class="upvipdetail">
                <span class="vipname">
                    <span class="grade" data-id="3">社区</span>
                 </span>
                <span class="vipprice">￥{$vip[2]['tip']}+{$vip[2]['condition']}GMOD</span>
                <div class="clear"></div>
            </div>
</div>

    <!-- 提交按钮 -->
    <div class="sumbitbtn">
        <a class="rightbtn" onclick="sub()">确认升级</a>
    </div>
    {/block}
    {block name="js"}
<script>
    // 点击选出状态
    $(".upvipdetail").on("click", function () {
        $(this).addClass("on").siblings().removeClass("on");
    })
</script>
<script>
    function sub(){
        var r=confirm("确定升级？");
        if(r == true){
            if($(".upvipdetail").hasClass('on')){
                var grade =$(".on .grade").attr('data-id');
                $.post("{:url('/langjinmobile/common/application')}",{type:grade},function(data){
                    if(data.code == 1){
                        layer.msg(data.msg, {
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        }, function(){
                            window.location.href = '/langjinmobile/my/my';
                        });
                    }else{
                        layer.msg(data.msg);
                    }
                })
            }else{
                msg_alert("请选择升级等级")
            }
        }
    }
</script>
    {/block}